package net.googlecode.morenko.task5.workers;

/**
 * The employee class.
 */
public class Employee extends Worker {
    private int experience;
    private boolean perHour;

    /**
     * Constructor, creates employee object.
     * @param firstName employees first name.
     * @param lastName  employees last name.
     * @param code the personal unique code.
     */
    public Employee(String firstName, String lastName, int code) {
        super(firstName, lastName, code);
        post = Jobs.EMPLOYEE;
    }

    /**
     * Set the value of employee experience.
     * @param experience the value of experience.
     */
    public void setExperience(int experience) {
        this.experience = (experience > 0) ? experience : 0;
    }

    /**
     * Get the value of employee experience.
     * @return employee experience value.
     */
    public int getExperience() {
        return this.experience;
    }
    /**
     * Set is the person has per hour rate.
     * @param perHour true or false.
     */
    public void setPerHour(boolean perHour) {
        this.perHour = perHour;
    }

    /**
     * Check is the person has per hour rate.
     * @return true or false.
     */
    public boolean isPerHour() {
        return this.perHour;
    }
}
